package com.tpay.client.entrypoint;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.user.client.Window;
import com.tpay.client.NameTokens;

public class EntryPointDispatcher implements EntryPoint {

	@Override
	public void onModuleLoad() {
		try {
			// Host Page 이름 얻기
			Dictionary dictionary = Dictionary.getDictionary("Pages");
			String page = dictionary.get("page");
			
			if(page.equals(NameTokens.mainPage)) {
				MultiPageEntryPoint entrypoint = (MultiPageEntryPoint)GWT.create(MainPageEntryPoint.class);
				entrypoint.onModuleLoad();
			}
		} catch(Exception e) {
			e.printStackTrace();
			
			Window.alert(e.getLocalizedMessage());
		}
		
	}

}
